﻿@model ProjectBordspil.Models.GuiViewModelModel
@using System.Web.Security;

@{

    ViewBag.Title = "GuilGameView";
}


<h2 class="H2Mem">Höggstokkurinn</h2>
<h3 class="NameOfCurrentGame">Nafn á leik: @Model.theGame.name</h3>

<div class="GuibuttonsDiv" id="NobelButtonsDivs">
    <h2 class="H2Gui">Nobel cards</h2>
    <table>
        <tr> 
             <td><img id="GulliImg" src ="http://www.pixeljoint.com/files/icons/full/pixelguillotine.gif" width="150px" height="200px"/></td>
        @foreach (var item in Model.Nobels)
        { 
            if(item.userGotNob == "up")
            {
                <td class="GuiTd">
                    <div class="GuibuttonDiv"><button type="button" class="NobelButton" id="@item.idImage" value="@item.nobelObject.value"><img class="GuiimageClass" src="@item.nobelObject.image"  height="150" width="100" alt="Hér er mynd" style="visibility:hidden"/> </button></div>
                </td>
            }
            else
            {
                <td class="GuiTd">
                    <div class="GuibuttonDiv"><button type="button" class="NobelButton" id="@item.idImage" value="@item.nobelObject.value"><img class="GuiimageClass" src="@item.nobelObject.image"  height="150" width="100" alt="Hér er mynd"style="visibility:visible"/> </button></div>
                </td>
            }
        }
        </tr>
     </table>
</div>

<div class="Container">
    <h3 class="H2Mem">Spjall</h3>

        <ul id="Discussion">
        </ul>
        <input type="hidden" id="Displayname" />
        <input type="text" id="Message" />
        <input type="button" id="Sendmessage" value="Senda" />
        
    </div>

<div class="GuiActButtonsDiv" id="ActionButtonsDivs">
    <h2 class="H2Gui">Action cards</h2>
    <table>
        <tr>
        @foreach (var item in Model.Actions)
        { 
            if( item.userGotAction == "used")
            {
                <td>
                    <div class="GuiActButtonDiv"><button type="button"  class="ActButton" id="@item.idImage"  value="@item.actionObject.value"><div class="Grow pic"><img src="@item.actionObject.image"   height="150" width="100" alt="Hér er mynd" style="visibility:hidden"/></div> </button></div>
                </td>
            }
            else
            {
                <td>
                    <div class="GuiActButtonDiv"><button type="button"  class="ActButton" id="@item.idImage"  value="@item.actionObject.value"><div class="Grow pic"><img src="@item.actionObject.image"   height="150" width="100" alt="Hér er mynd" style="visibility:visible"/></div> </button></div>
                </td>               
            }
        }
        </tr>
     </table>
</div>

<div id="GameStatus">
<div id="Line1"><div style="visibility:hidden" id="YourTurn1">Þú átt að gera -></div> <div id="User1" class="H2Mem">Notandi1:<span id ="SUser1"></span> Stig:<span id ="ScoreUser1">@Model.theGame.userOneScore</span></div></div>
<div id="Line2"><div style="visibility:hidden" id="YourTurn2">Þú átt að gera -></div> <div id="User2" class="H2Mem">Notandi2:<span id ="SUser2">@Model.theGame.user2</span> Stig:<span id ="ScoreUser2">@Model.theGame.userTwoScore</span></div></div>
</div>

 <script>
     var group = '@(Model.theGame.id)';
     var g_username = '@User.Identity.Name';
     var user = "@Membership.GetUser().UserName";
 </script>

<script src="/Scripts/GuiGameScript.js"></script>
<script src="/Scripts/ChatHubScript.js"></script>